def bifind(nums, target):
    i = 0
    j = len(nums)

    while(i<j):
        mid = (i + j)//2
        if( nums[mid] == target):
            return mid
        elif(nums[mid] > target):
            if(j == mid):
                return -1
            j = mid
        elif(nums[mid] < target):
            if(i == mid):
                return -1
            i = mid
    else:
        return -1
        

if __name__ == '__main__':
    n = int(input())
    nums = []

    target = int(input())

    for i in range(n):
        nums.append(int(input()))

    print(bifind(nums,target))